<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/EmptyPHPWebPage.php to edit this template
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>

<table border="1px">
            <tr>
                <th>图片</th>
                <th>ID</th>
                <!-- <th>班级</th> -->
                <th>用户名</th> 
                <!-- <th>密码</th> -->
                <th>年龄</th>
                <!-- <th>年龄</th> -->
                <th>操作</th>
            </tr>


        
        <?php
        // put your code here
        $hostname="127.0.0.1";
        $username="root";
        $password="123456";
        $database="mysql123";

        $connet=mysqli_connect($hostname, $username, $password, $database);
        mysqli_set_charset($connet, "utf-8");
      
        if($connet){
            echo "链接成功";
            
//          $sqlstring="insert into user_inf(uname,sex,age) "
//                  ." values('李四','女','18')";
              $sqlstring="select * from user_inf";
            $result= mysqli_query($connet, $sqlstring);
            $row= mysqli_fetch_array($result);
           ?>
           <br/> <a href="add.php">添加新用户</a> 
        <?php
             while ($row){
                 if($row){
            ?>
            
                <tr>
                    <td>
                         <img src="<?php echo $row["ipx"]?>" style="height: 100px;width: 100px";>
                         <!-- <?php echo $row["ipx"];?> -->
                    </td> 
                    <td> <?php echo $row["uid"];?></td> 
                    <!-- <td> <?php echo $row["class"];?></td>  -->
                    <td> <?php echo $row["uname"];?></td> 
                    <!-- <td> <?php echo $row["upasswd"];?></td>  -->
                    <!-- <td> <?php echo $row["sex"];?></td>  -->
                    <td> <?php echo $row["age"];?></td> 
                    <td>
                    <!-- <a href="./myadd.php">添加</a>
                        <a href="./myupdate.php">修改</a> -->
                        <a href="del.php?id=<?php echo $row['uid']?>">删除</a>
                        <a href="update.php?id=<?php echo $row['uid']?>">修改</a>

                    </td>
                    </br>
                </tr>
                    <?php
                     
                    }
                 $row= mysqli_fetch_array($result);
                 }
                     
             

            
            
        }else{
            echo '链接失败';
        }
        
        
        
 
        
          mysqli_close($connet);
        ?>
    </body>
</html>